﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace libnbot
{
    public interface IDataEngine
    {
        Boolean IsPageExists(String url);
        Page GetPage(DateTime updatedBefore);
        Page GetPage(String url);
        Page GetPage(Int32 pageId);        
        void SavePage(Page page);

        Boolean IsKeywordExists(String text);
        Keyword GetKeyword(String text);
        Keyword GetKeyword(Int32 keywordId);
        void SaveKeyword(Keyword keyword);

        Boolean IsDomainExists(String name);
        Domain GetDomain(String name);
        Domain GetDomain(Int32 domainId);
        void SaveDomain(Domain domain);

        Boolean IsLinkedBetween(String url, String keyword);
        PageKeywordLink[] GetPageKeywordLink(String filter, Boolean filterIsKeyword);
        PageKeywordLink GetLinkBetween(String url, String keyword);
        void RemoveLinkBetween(String url, String keyword);
    }
}
